//
//  AppStyle.h
//  TabbarBeyondClick
//
//  Created by 苗志超 on 2017/4/18.
//  Copyright © 2017年 . All rights reserved.
//



#ifndef AppStyle_h
#define AppStyle_h

//*****************************************************************************
#ifdef DEBUG
#define NSLog(FORMAT, ...) printf("%s\n", [[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String]);
#else
#define NSLog(format,...)
#endif
//*****************************************************************************
//self弱引用
#define WEAKSELF typeof(self) __weak weakSelf = self;
//self强引用
#define STRONGSELF typeof(weakSelf) __strong strongSelf = weakSelf;

//返回字体大小
#define Nav_Back_Font_M [UIFont systemFontOfSize:14]

//储存
#define defaults [NSUserDefaults standardUserDefaults]

//颜色
#define ColorI(c) [UIColor colorWithRed:((c>>16)&0xff)/255.0 green:((c>>8)&0xff)/255.0 blue:(c&0xff)/255.0 alpha:1.0]
#define RGB(r,g,b)      [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:1.0]
#define Theme_Color_Red  RGB(231,56,55)
#define Theme_Color_Pink RGB(255,83,123)
#define Theme_Color_White [UIColor whiteColor]
#define Theme_Color_Black [UIColor blackColor]

#define Theme_Color_Orange RGB(255,178,148)
#define Theme_Color_Peach RGB(253,184,202)
#define Theme_NavColor   RGB(255,255,255)
#define Theme_TextColor RGB(55,65,75)
#define TheMainColor ColorI(0xffeb8e)
#define TheLinColor RGB(242, 244, 244)
#define Colorbackground ColorI(0xfdd815)
#define ColorblackFont ColorI(0x404f68)

#define RandomColor [UIColor colorWithRed:arc4random_uniform(255)/255.0 green:arc4random_uniform(255)/255.0 blue:arc4random_uniform(255)/255.0 alpha:1];
//IPhone屏幕类型定义

// iPhone4
//#define iPhone4 ([UIScreen mainScreen].bounds.size.height == 480.0)
// iPhone5
#define iPhone5 ([UIScreen mainScreen].bounds.size.height == 568.0)
// iPhone6
#define iPhone6 ([UIScreen mainScreen].bounds.size.height == 667.0)
// iPhone6p
#define iPhone6p ([UIScreen mainScreen].bounds.size.height == 736.0)

// 以5.5寸屏的宽度为基准，计算宽比和高比
#define	SCREEN_WIDTH_RATIO55	KScreenWidth/414.0f
// 以4.7寸屏的宽度为基准，计算宽比和高比
#define SCREEN_WIDTH_RATIO47   KScreenWidth/375.0f


// 4ihch字体
#define Font(s) [UIFont fontWithName:@"STHeitiSC-Light" size:s]
#define FontBold(s) [UIFont  fontWithName:@"STHeitiSC-Medium" size:s]
#define FontNum(s) [UIFont fontWithName:@"Avenir-Light" size:s]
#define FontP(s) [UIFont fontWithName:@"PingFang-SC-Regular" size:s]
#define FontM(s) [UIFont fontWithName:@"PingFang-SC-Medium" size:s]

//导航栏颜色
#define kNavigationBarBg  RGB(206,8,2) //#ce0802

//屏幕宽度 高度
#define KScreenWidth [UIScreen mainScreen].bounds.size.width
#define KScreenHeight [UIScreen mainScreen].bounds.size.height

// 1.判断是否为iOS7
#define iOS7 ([[UIDevice currentDevice].systemVersion doubleValue] >= 7.0)
#define ViewController_BackGround [UIColor colorWithRed:243.0/255.0 green:243.0/255.0 blue:243.0/255.0 alpha:1.0]
//视图控制器背景颜色
//计算文本尺寸
#define textSizeFont(text, fontSizeFont, width, height) [text boundingRectWithSize:CGSizeMake(width, height) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:fontSizeFont} context:nil].size;



// 以5.5寸屏的宽度为基准，计算宽比和高比
#define	SCREEN_WIDTH_RATIO55	KScreenWidth/414.0f


// 以4.7寸屏的宽度为基准，计算宽比和高比
#define SCREEN_WIDTH_RATIO47   KScreenWidth/375.0f



//********************************************************************************
//获取用户ID   用户Token（注册融云）
#define USERTOKEN [HQHttpManager getUserToken]
#define USERUID   [HQHttpManager getUserId]
/*****************内购 内购  内购 **********/

#define ProductID_IAP0p6 @"SpeedDating001"//6
#define ProductID_IAP1p30 @"SpeedDating002" //30
#define ProductID_IAP2p98 @"SpeedDating003" //98
#define ProductID_IAP3p298 @"SpeedDating004" //298

//服务器主域名
#define HttpUrlString @"http://119.23.216.7:8082/everyday/"
#define HttpUrlStringS(subUrl)  [NSString stringWithFormat:@"http://119.23.216.7:8082/everyday/%@",subUrl]


//测试
//#define HttpUrlString @"http://192.168.1.210:8092/"
//#define HttpUrlStringS(subUrl)  [NSString stringWithFormat:@"http://192.168.1.210:8092/%@",subUrl]


//图片主域名
#define HttpImgUrlString @"http://119.23.216.7:8081/"
#define HttpImgUrl(subUrl)  [NSString stringWithFormat: @"http://119.23.216.7:8081/%@",subUrl]


////测试图
//#define HttpImgUrlString @"http://192.168.1.210:8082/"
//#define HttpImgUrl(subUrl)  [NSString stringWithFormat: @"http://192.168.1.210:8082%@",subUrl]
#define kImgUrl(url) [HttpImgUrlString stringByAppendingString:url]

// 融云开发者控制台注册得到的 App Key
#define kRongYunAppKey  @"82hegw5u83zbx"



//#define kRongYunAppKey  @"tdrvipkstdh85"

//是否登录通知
#define KNOTIFICATION_isLogin @"KNOTIFICATION_isLogin"
//Token
#define keyPath(objc,keyPath) @(((void)objc.keyPath,#keyPath))
//判断是否为空
#define KCNSSTRING_ISEMPTY(str) (str == nil || [str isEqual:[NSNull null]] || str.length <= 0)


//腾讯云
/******************** local param **********************/
#define kLoginParam         @"kLoginParam"
#define kLoginIdentifier    @"kLoginIdentifier"
#define kLoginPassward      @"kLoginPassward"
#define kEnvParam           @"kEnvParam"
#define kLogLevel           @"kLogLevel"
#define kBeautyScheme       @"kBeautyScheme"
#define kILiveBeauty        @"插件美颜"
#define kQAVSDKBeauty       @"内置美颜"

#define ShowCloudAppId       @"1400032058"
#define ShowCloudAccountType @"13872"
//高清
#define kSxbRole_HostHD     @"HD"
//主播角色标题
#define kSxbRole_HostHDTitle @"1、高清(1280x720,25fps)"
#define kSxbRole_InteractHD @"HDGuest"
//连麦角色标题
#define kSxbRole_InteractHDTitle @"1、高清(1280x720,25fps)"

/**************************监听****************************/
//创建删除退出房间监听
#define kNoPureDelete_Notification      @"kNoPureDelete_Notification"
#define kPureDelete_Notification        @"kPureDelete_Notification"
//添加小视图
#define kCancelConnect_Notification     @"kCancelConnect_Notification"



typedef NS_ENUM(NSInteger, BeautyViewType)
{
    BeautyViewType_Beauty = 0,
    BeautyViewType_White,
};

typedef NS_ENUM(NSInteger, RoomOptionType)
{
    RoomOptionType_CrateRoom = 0,
    RoomOptionType_JoinRoom,
};

typedef NS_ENUM(NSInteger, ShowCustomCmd)
{
    AVIMCMD_Text = -1,          // 普通的聊天消息
    
    AVIMCMD_None,               // 无事件：0
    
    // 以下事件为TCAdapter内部处理的通用事件
    AVIMCMD_EnterLive,          // 用户加入直播, Group消息 ： 1
    AVIMCMD_ExitLive,           // 用户退出直播, Group消息 ： 2
    AVIMCMD_Praise,             // 点赞消息, Demo中使用Group消息 ： 3
    AVIMCMD_Host_Leave,         // 主播或互动观众离开, Group消息 ： 4
    AVIMCMD_Host_Back,          // 主播或互动观众回来, Group消息 ： 5
    AVIMCMD_Cancel_Back,        //取消互动
    AVIMCMD_Gift_Back,          //送礼物
    
    
    //    ShowCustomCmd_Begin = ILVLIVE_IMCMD_CUSTOM_LOW_LIMIT,
    //    ShowCustomCmd_Praise,
    //    ShowCustomCmd_JoinRoom,
    //    ShowCustomCmd_DownVideo,//主播发送下麦通知
    
    AVIMCMD_Multi = ILVLIVE_IMCMD_CUSTOM_LOW_LIMIT,              // 多人互动消息类型 ： 2048
    
    AVIMCMD_Multi_Host_Invite,          // 多人主播发送邀请消息, C2C消息 ： 2049
    AVIMCMD_Multi_CancelInteract,       // 已进入互动时，断开互动，Group消息，带断开者的imUsreid参数 ： 2050
    AVIMCMD_Multi_Interact_Join,        // 多人互动方收到AVIMCMD_Multi_Host_Invite多人邀请后，同意，C2C消息 ： 2051
    AVIMCMD_Multi_Interact_Refuse,      // 多人互动方收到AVIMCMD_Multi_Invite多人邀请后，拒绝，C2C消息 ： 2052
    
    // =======================
    // 暂未处理以下
    AVIMCMD_Multi_Host_EnableInteractMic,  // 主播打开互动者Mic，C2C消息 ： 2053
    AVIMCMD_Multi_Host_DisableInteractMic, // 主播关闭互动者Mic，C2C消息 ：2054
    AVIMCMD_Multi_Host_EnableInteractCamera, // 主播打开互动者Camera，C2C消息 ：2055
    AVIMCMD_Multi_Host_DisableInteractCamera, // 主播关闭互动者Camera，C2C消息 ： 2056
    // ==========================
    
    
//    AVIMCMD_Multi_Host_CancelInvite,            // 取消互动, 主播向发送AVIMCMD_Multi_Host_Invite的人，再发送取消邀请， 已发送邀请消息, C2C消息 ： 2057
//    
//    AVIMCMD_Multi_Gift_Action, //2509
    
};

#endif /* AppStyle_h */
